function f = ccp_equil(W,M)

ccp = zeros(M,M);
for i = 1 : M
    a = mean(W(i,:));
    for j = 1 : M
        ccp(i,j) = exp(W(i,j)-a)/sum(exp(W(i,:)-a),2);
     end
end

f = ccp;
